Object.prototype.size = function(obj) {
    var size = 0, key;
    for (key in obj) {
        if (obj.hasOwnProperty(key)) size++;
    }
    return size;
};

String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}

String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

jQuery.getCSS = function(url) {
        jQuery( document.createElement('link') ).attr({
                href: url,
                type: 'text/css',
                rel: 'stylesheet'
        }).appendTo('head');
};
